#include"IconHelper.h"

IconHelper *IconHelper::_instance = 0;
IconHelper::IconHelper(QObject * ):QObject(qApp)
{
    int fontId=QFontDatabase::addApplicationFont(":/QSS/font/fontawesome-webfont.ttf");
    QString fontName=QFontDatabase::applicationFontFamilies(fontId).at(0);
    iconFont=QFont(fontName);
}
void IconHelper::SetIcon(QLabel *ctl,QChar c,int size)
{
    iconFont.setPointSize(size);
    ctl->setFont(iconFont);
    ctl->setText(c);
}
void IconHelper::SetIcon(QPushButton *ctl,QChar c,int size)
{
    iconFont.setPointSize(size);
    ctl->setFont(iconFont);
    ctl->setText(c);
}

void IconHelper::SetIcon(QToolButton *ctl,QChar c,int size)
{
    iconFont.setPointSize(size);
    ctl->setFont(iconFont);
    ctl->setText(c);
}
